<?php

//折翼天使资源社区 提供 www.zheyitianshi.com
if (!defined('IN_IA')) {
	die('Access Denied');
}
if (!class_exists('VerifyModel')) {
	class VerifyModel extends PluginModel
	{
		public function createQrcode($orderid = 0)
		{
			global $_W, $_GPC;
			$path = IA_ROOT . "/addons/ewei_shop/data/qrcode/" . $_W['uniacid'];
			if (!is_dir($path)) {
				load()->func('file');
				mkdirs($path);
			}
			$url = $_W['siteroot'] . 'app/index.php?i=' . $_W['uniacid'] . '&c=entry&m=ewei_shop&do=plugin&p=verify&method=detail&id=' . $orderid;
			$file = 'order_verify_qrcode_' . $orderid . '.png';
			$qrcode_file = $path . '/' . $file;
			if (!is_file($qrcode_file)) {
				require IA_ROOT . '/framework/library/qrcode/phpqrcode.php';
				QRcode::png($url, $qrcode_file, QR_ECLEVEL_H, 4);
			}
			return $_W['siteroot'] . '/addons/ewei_shop/data/qrcode/' . $_W['uniacid'] . '/' . $file;
		}
		public function perms()
		{
			return array('verify' => array('text' => $this->getName(), 'isplugin' => true, 'child' => array('keyword' => array('text' => '关键词设置-log'), 'store' => array('text' => '门店', 'view' => '浏览', 'add' => '添加-log', 'edit' => '修改-log', 'delete' => '删除-log'), 'saler' => array('text' => '核销员', 'view' => '浏览', 'add' => '添加-log', 'edit' => '修改-log', 'delete' => '删除-log'))));
		}
	}
}